﻿#pragma once

#include "../common/BasePclProvider.h"
#include "./RegionGrowingSegmentationModel.h"
#include "pcl/includePcl.h"

/// <summary>
/// RegionGrowingSegmentationProvider
/// </summary>
class RegionGrowingSegmentationProvider : public BasePclProvider
{
    Q_OBJECT

public:
    RegionGrowingSegmentationProvider();

public:
    void initEditor(QtTreePropertyBrowser* editor);
    void valueChanged(QtProperty*, double) override;
    void valueChanged(QtProperty*, QString) override;
    void valueChanged(QtProperty*, int) override;
    void valueChanged(QtProperty*, bool) override;
    void valueChanged(QtProperty*, const QColor&) override;
    void close() override;
    void doLoadPcd();
    void doAction();

private:
    /**
     * @brief Color-based region growing segmentation
     * https://pcl.readthedocs.io/projects/tutorials/en/master/region_growing_rgb_segmentation.html
     * data: https://raw.github.com/PointCloudLibrary/data/master/tutorials/region_growing_rgb_tutorial.pcd
     * @param cloud
     * @return
     */

    void impl(pcl::PointCloud<pcl::PointXYZRGB>::Ptr cloud, RegionGrowingSegmentationModel& model);
};
